package com.sysassist.procmgr;

import com.sysassist.MainActivity;
import com.sysassist.R;

import android.app.Activity;
import android.os.Bundle;
//import android.view.Menu;
//import android.view.MenuInflater;
//import android.view.MenuItem;
import android.widget.TextView;

public class ProcDetailActivity extends Activity {

	@Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.proc_detail);
		
        // 取得进程详细信息
		DetailProgramUtil detailProgramUtil = (DetailProgramUtil) getIntent()
				.getSerializableExtra(ProcMgrActivity.PROC_DETAIL_KEY);
        // 设定显示内容
        showContent(detailProgramUtil);
	}

	/**
	 * 显示内容
	 * @param detailProgramUtil 
	 */
	private void showContent(DetailProgramUtil detailProgramUtil) {
		// 进程名
		TextView processNameTv = (TextView) findViewById(R.id.detail_process_name);
		processNameTv.setText(detailProgramUtil.getProcessName());
		// 版权信息
		TextView copyrightTv = (TextView) findViewById(R.id.detail_process_copyright);
		copyrightTv.setText("公司:" + detailProgramUtil.getCompanyName()
				+ "  版本:" + detailProgramUtil.getVersionName()
				+ " (" + detailProgramUtil.getVersionCode() + ")");
		// 安装目录
		TextView installDirTv = (TextView) findViewById(R.id.detail_process_install_dir);
		installDirTv.setText(detailProgramUtil.getSourceDir());
		// 数据目录
		TextView dataDirTv = (TextView) findViewById(R.id.detail_process_data_dir);
		dataDirTv.setText(detailProgramUtil.getDataDir());
		// 操作权限
		TextView userPermissionsTv = (TextView) findViewById(R.id.detail_process_permission);
		userPermissionsTv.setText(detailProgramUtil.getUserPermissions());
		// 服务信息
		TextView servicesTv = (TextView) findViewById(R.id.detail_process_service);
		servicesTv.setText(detailProgramUtil.getServices());
		// 活动信息
		TextView activitiesTv = (TextView) findViewById(R.id.detail_process_activity);
		activitiesTv.setText(detailProgramUtil.getActivities());
	}
}
